package com.crk.yiyuanguahao.controller;

import com.crk.yiyuanguahao.service.RoleAuthService;
import com.crk.yiyuanguahao.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author
 * @description:
 * @date 2020/2/5
 */
@RestController
@RequestMapping("roleAuth")
public class RoleAuthController {

    @Autowired
    RoleAuthService roleAuthService;

    @GetMapping("manage")
    public ModelAndView manage(){
        ModelAndView modelAndView = new ModelAndView("/workspace/roleAuth/roleAuthList.html");
        return modelAndView;
    }

    @GetMapping("detail")
    public ModelAndView detail(){
        ModelAndView modelAndView = new ModelAndView("/workspace/roleAuth/roleAuthAdd.html");
        return modelAndView;
    }

    @RequestMapping("queryRoleListTreeByUser")
    public ResponseResult queryRoleListTreeByUser(@RequestParam int userId){
        return roleAuthService.queryRoleListTreeByUser(userId);
    }

}
